package com.ccc.demo1;

import scala.runtime.AbstractFunction3;

import java.io.Serializable;

//状态更新方法
public class MyVprog extends AbstractFunction3<Object, String, String, String> implements Serializable {

    @Override
    public String apply(Object id, String color, String msg) {
        System.out.println(String.format("id:%s, color:%s, msg:%s", id.toString(), color, msg));
        if (color.equals("black")) {
            return "black";
        }
        if (msg.equals("black")) {
            return "gray";
        }
        return "white";
    }
}
